using System.Text.Json.Serialization;

namespace Sage.CloudStorage.Qiniu.Models
{
    /// <summary>
    /// CDN带宽查询结果
    /// </summary>
    public class CdnBandwidthResult
    {
        /// <summary>
        /// 状态码
        /// </summary>
        [JsonPropertyName("code")]
        public int Code { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        [JsonPropertyName("error")]
        public string? Error { get; set; }

        /// <summary>
        /// 时间点列表
        /// </summary>
        [JsonPropertyName("time")]
        public List<string>? Time { get; set; }

        /// <summary>
        /// 带宽数据（域名为键，带宽数据为值）
        /// </summary>
        [JsonPropertyName("data")]
        public Dictionary<string, BandwidthData>? Data { get; set; }
    }

    /// <summary>
    /// 带宽数据
    /// </summary>
    public class BandwidthData
    {
        /// <summary>
        /// 国内带宽数据
        /// </summary>
        [JsonPropertyName("china")]
        public List<ulong>? China { get; set; }

        /// <summary>
        /// 海外带宽数据
        /// </summary>
        [JsonPropertyName("oversea")]
        public List<ulong>? Oversea { get; set; }
    }
}